//
//  KumquatExplosion.m
//  Return Of The Lemi
//
//  Created by Paul Vishayanuroj on 12/9/09.
//  Copyright 2009 Paul Vishayanuroj. All rights reserved.
//

#import "KumquatExplosion.h"
#import "TextureMgr.h"
#import "Director.h"

@implementation KumquatExplosion

-(id) init
{
	return [self initWithTotalParticles:6];
}

-(id) initWithTotalParticles:(int)p
{
	if( !(self=[super initWithTotalParticles:p]) )
		return nil;
	
	// duration
	duration = 0.1f;
	
	// gravity
	gravity.x = 0;
	gravity.y = -500;
	
	// angle
	angle = 90;
	angleVar = 360;
	
	// speed of particles
	speed = 50;
	speedVar = 25;
	
	// radial - how fast they accelerate away
	radialAccel = 50;
	radialAccelVar = 25;
	
	// tagential - how fast they spin around from the origin
	tangentialAccel = 100;
	tangentialAccelVar = 50;
	
	// emitter position
	position_.x = 160;
	position_.y = 240;
	posVar.x = 0;
	posVar.y = 0;
	
	// life of particles
	life = 0.3f;
	lifeVar = 0;
	
	// size, in pixels
	startSize = 5.0f;
	startSizeVar = 3.0f;
	endSize = kParticleStartSizeEqualToEndSize;
	
	// emits per second
	emissionRate = totalParticles/duration;
	
	// color of particles
	startColor.r = 0.99f;
	startColor.g = 0.99f;
	startColor.b = 0.99f;
	startColor.a = 1.0f;
	startColorVar.r = 0.0f;
	startColorVar.g = 0.0f;
	startColorVar.b = 0.0f;
	startColorVar.a = 0.0f;
	endColor.r = 0.99f;
	endColor.g = 0.99f;
	endColor.b = 0.99f;
	endColor.a = 1.0f;
	endColorVar.r = 0.0f;
	endColorVar.g = 0.0f;
	endColorVar.b = 0.0f;
	endColorVar.a = 0.0f;
	
	self.texture = [[TextureMgr sharedTextureMgr] addImage: @"Kumquat.png"];
	
	// additive
	blendAdditive = NO;
	
	return self;
}


@end
